`timescale 1ns/100ps

module sm4_test_top ;
    parameter simulation_cycle = 10;

    bit SystemClock;
    sm4_io top_io(SystemClock);
    test t(top_io);

    SM4_Core SM4_Core_0(
    .clk_i(top_io.clock),
    .rst_n_i(top_io.reset_n),
    
    .MK_Valid_i(top_io.key_valid),
    .Key_i(top_io.MK),
    .Data_Valid_i(top_io.data_valid),
    .Data_i(top_io.din),
    .mode_i(top_io.mode_in),      //00:密钥拓展 11：加密 01：解密
    .RK_Ready_o(top_io.key_ex_finished),
    .Data_Ready_o(top_io.data_ready),
    .Data_o(top_io.dout) 
);

initial begin
    $timeformat(-9, 1, "ns", 10);
    SystemClock = 0;
    forever begin
        #(simulation_cycle/2)
            SystemClock = ~SystemClock;
    end
end



endmodule